﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Smart.Windows.Navigation;
using Smart.Windows.Navigation.Parameter;

namespace NavigationSampleApp.View
{
    /// <summary>
    /// 
    /// </summary>
    [View(Views.DataList)]
    public partial class DataListView : AppViewBase
    {
        [ViewParameter(Direction.Export)]
        protected string selectedId;

        /// <summary>
        /// 
        /// </summary>
        public DataListView()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        public override void OnViewOpen(ViewForwardEventArgs args)
        {
            FormControl.SetTitle( "従業員リスト" );
            FormControl.SetButtonLeft( "戻る" );
            FormControl.SetButtonRight( "新規作成" );
        }

        /// <summary>
        /// 
        /// </summary>
        public override void OnButtonLeft()
        {
            Navigator.Forward( Views.Menu );
        }

        /// <summary>
        /// 
        /// </summary>
        public override void OnButtonRight()
        {
            Navigator.Push( Views.DataDetailNew );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEdit_Click(object sender, EventArgs e)
        {
            // パラメータ
            this.selectedId = "123";

            Navigator.Push( Views.DataDetailEdit );
        }
    }
}
